#!usr/bin/env python  
# -*- coding:utf-8 -*-

from django.template import Library
from bbd_admin.models import NavUrlSetting

register = Library()


@register.filter()
def set_navs(string):
    nav_list = []
    navs = NavUrlSetting.objects.all().order_by('-index')
    for nav in navs:
        nav_list.append({
            "link": nav.link,
            "name": nav.name,
        })
    return nav_list
